﻿/*  Kiva.NET
 *  Copyright (c) 2009 Arun Kumar 
 *  middleforce@gmail.com
 */
using System;

namespace KivaLibrary
{
    public class KivaError : System.Exception
    {
        internal KivaError(string errMessage, string errSource, Exception exObj)
        {
            mErrorMessage = errMessage;
            mErrorSource = errSource;
            mSourceException = exObj;
        }
        string mErrorSource;
        public string ErrorSource
        {
            get { return mErrorSource; }
        }
        string mErrorMessage;
        public string ErrorMessage
        {
            get { return mErrorMessage; }
        }
        Exception mSourceException;
        public Exception SourceException
        {
            get { return mSourceException; }
        }
    }
    public class ErrorFactory
    {
        public static void ErrorHandler(string errMessage, string errSource, Exception exObj)
        {
            // TODO: Add Error Handling code here.
            KivaError ke = new KivaError(errMessage, errSource, exObj);
            throw ke;
        }
    }

}
